package chapter_7;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class Test12 {
    public static void main(String[] args) throws Exception{
        long l = System.currentTimeMillis();
        FileInputStream fis = new FileInputStream("D:\\a.jpg");
        BufferedInputStream bis = new BufferedInputStream(fis);
        FileOutputStream fos = new FileOutputStream("D:\\buf.jpg");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        int b ;
        while(( b = bis.read()) != -1){
            bos.write(b);
        }
        long l1 = System.currentTimeMillis();
        System.out.println(l1-l);
        bis.close();
        bos.close();
    }
}
